package com.imufe.chemicalenterprisedangerwarning.entity.query;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.imufe.chemicalenterprisedangerwarning.annotation.ExistId;
import com.imufe.chemicalenterprisedangerwarning.mapper.DepartmentMapper;
import com.imufe.chemicalenterprisedangerwarning.mapper.EnterpriseMapper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * @author BaiBan
 * @since 2022/9/26
 */
@ApiModel("项目请求")
@Data
public class ProjectQuery {

    @ApiModelProperty("项目编号")
    @Null(message = "创建时项目编号不能填", groups = CreateGroup.class)
    @NotNull(message = "修改时项目编号必须填", groups = UpdateGroup.class)
    private Long id;

    @ApiModelProperty("项目名称")
    @NotNull(message = "项目名称不能为空", groups = CreateGroup.class)
    private String name;

    @ApiModelProperty("所属企业编号")
    @ExistId(message = "企业不存在，请选择正确的企业", groups = CreateGroup.class, value = EnterpriseMapper.class)
    @Null(message = "修改时企业编号不填", groups = UpdateGroup.class)
    private Long enterpriseId;
}